package com.qijian.common.enums;


import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

@Getter
@AllArgsConstructor
public enum FlowableCodeEnum {

    flow_re_eq("REEQ", "equipmentLedgerServiceImpl","com.qijian.maindata.domain.EquipmentLedger"),
    flow_re_eq_c("REEQC", "equipmentLedgerServiceImpl","com.qijian.maindata.domain.EquipmentLedger"),

    flow_re_gz("REGZ", "frockLedgerServiceImpl","com.qijian.maindata.domain.FrockLedger"),

    flow_re_gz_c("REGZC", "frockLedgerServiceImpl","com.qijian.maindata.domain.FrockLedger"),


    flow_re_eq_bf("REBFEQ", "equipmentLedgerServiceImpl","com.qijian.maindata.domain.EquipmentLedger"),


    flow_re_gz_bf("REBFGZ", "frockLedgerServiceImpl","com.qijian.maindata.domain.FrockLedger"),

    flow_re_knife_pick("KNIFEPICK", "knifeUseServiceImpl","com.qijian.maindata.domain.dto.KnifeUseDto"),

    flow_re_knife_return("KNIFERETURN", "knifeUseServiceImpl","com.qijian.maindata.domain.dto.KnifeUseDto"),


    flow_re_knife_sale("KNIFESALE", "frockLedgerServiceImpl","com.qijian.maindata.domain.FrockLedger"),


    flow_re_knife_transfer("KNIFETRANSFER", "frockLedgerServiceImpl","com.qijian.maindata.domain.FrockLedger"),

    flow_order_de_ex("DEEC", null,null),


    flow_re_knife_move("KM", null,null),

    flow_fin_cost_ex("FINEX", null,null);


    @EnumValue
    private final String value;

    @JsonValue
    private final String description;

    private final String classType;

    private static final Map<String, String> ENUM_FLOW_CODE_MAP = new HashMap<>();


    private static final Map<String, String> ENUM_FLOW_TYPE_MAP = new HashMap<>();

    static {
        for (FlowableCodeEnum item : values()) {
            ENUM_FLOW_CODE_MAP.put(item.getValue(), item.getDescription());
        }

        for (FlowableCodeEnum item : values()) {
            ENUM_FLOW_TYPE_MAP.put(item.getValue(), item.getClassType());
        }
    }

    public static String flowToValues(String value) {
        return ENUM_FLOW_CODE_MAP.get(value);
    }


    public static String flowToValueTpe(String value) {
        return ENUM_FLOW_TYPE_MAP.get(value);
    }


}
